CC = gcc
CFLAGS = -Wall -g
LDFLAGS = -ltss2-sys -ltss2-tctildr -ltss2-rc

TCTI_NAME := $(shell if [ -c /dev/tpm0 ] || [ -c /dev/tpmrm0 ]; then echo "tabrmd"; else echo "mssim"; fi)
CFLAGS += -DTCTI_NAME=\"$(TCTI_NAME)\"

all: sequence_hash.run

sequence_hash.run: sequence_hash.c
	$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS)

run: sequence_hash.run
	./sequence_hash.run

clean:
	rm -f sequence_hash.run
